<?php

namespace app\model;

use think\Model;

class BaseModel extends Model
{
    const DELETED = 0;

    /**
     * 保存数据
     * @param $data
     * @param array $condition
     * @return $this|int|string
     */
    public function saveData($data,$condition=[]){
        if($condition){
            return $this->where($condition)->update($data);
        }
        return $this->insertGetId($data);
    }
}